package com.android.miniskirt.ui;

import android.app.TabActivity;
import android.content.Intent;  
import android.graphics.Color;
import android.os.Bundle;  
import android.view.Gravity;
import android.widget.TabHost;  
import android.widget.TabWidget;
import android.widget.TextView;
   
public class minitab extends TabActivity{  
  
     public TabHost tabHost;  
   
     public void onCreate(Bundle savedInstanceState) {  
         super.onCreate(savedInstanceState);
         TabHost tabHost = getTabHost();
         final TabWidget tabWidget = tabHost.getTabWidget();
         TextView txtTabInfo = new TextView(this);
         txtTabInfo.setText("联系人");
         txtTabInfo.setPadding(0, 5, 0, 0);
         txtTabInfo.setTextSize(11);

//         txtTabInfo.setBackgroundResource(R.drawable.bg_tab_left_active_right_inactive);
         txtTabInfo.setTextColor(Color.TRANSPARENT);
         txtTabInfo.setGravity(Gravity.CENTER_HORIZONTAL);
         txtTabInfo.setHeight(39);

         int height = 40;
         int width = 50;
         tabHost.addTab(tabHost.newTabSpec("tab1")   
        		                  .setIndicator("联系人")   
        		                  .setContent(new Intent(this, FirstGroup.class)));
         
         tabHost.addTab(tabHost.newTabSpec("tab2")   
                 .setIndicator("最近联系人")   
                 .setContent(new Intent(this, FirstGroup.class)));
         
         tabHost.addTab(tabHost.newTabSpec("tab3")   
                 .setIndicator("群聊室")   
                 .setContent(new Intent(this, FirstGroup.class)));
         tabHost.setCurrentTab(0);
         
         for (int i =0; i < tabWidget.getChildCount(); i++) {

             //设置tab的高度、宽度

             tabWidget.getChildAt(i).getLayoutParams().height = height;

             tabWidget.getChildAt(i).getLayoutParams().width = width;
             
//             tabWidget.getChildAt(i).setBackgroundColor();

    }
     }
}